

using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UIElements;
using static UnityEditor.Search.SearchColumn;

public class GameSystem :MonoBehaviour
{
    static GameSystem instance = new GameSystem();
    static public GameSystem Instance =>instance;


    [HideInInspector]
    public SceneController sceneController;


    [HideInInspector]
    public UCameraControll uCameraController;

    [HideInInspector]
    public EventSystem eventSystem;

    public Transform GetCurSelectItem(GameObject ob ,string name)
    {
        Transform res = null;
        if(ob != null 
            && ob.name.StartsWith(name))
        {
            res = ob.transform;
        }
        return res;
    }
    public void Init(Transform mainEntry)
    {
        sceneController = mainEntry.GetComponent<SceneController>();
        uCameraController = mainEntry.Find("Camera").GetComponent<UCameraControll>();
        eventSystem = mainEntry.Find("EventSystem").GetComponent<EventSystem>();
    }
}